/*my lab4 test
  try to debug*/

#include "lib.h"
int a[100];
void umain()
{
	int i = 0;
	int nowid;
	int rc;
	a[2] = 10;

	if ((nowid = fork()) == 0) {
		for (i = 0; i < 100000; i++) {

		}
		rc = ipc_recv(&nowid, 0, 0);
		writef("%d is going to send\n", nowid);
		ipc_send(nowid, 123, 0, 0);
		writef("send to %d\n", nowid);
	} else {
		a[3] = 20;
		ipc_send(nowid, 456, 0, 0);
		writef("send to %d\n", nowid);
		rc = ipc_recv(&nowid, 0, 0);
		writef("%d\n", env->env_id);
	}

	writef("%d %d %d %d %d %d\n", syscall_getenvid(), nowid, a[2], a[3], rc, i);
}
